import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)
const routerPush = Router.prototype.push
Router.prototype.push = function push (location) {
  return routerPush.call(this, location).catch(error => error)
}
export default new Router({
  routes: [
    {
      path: '/',
      name: '首页',
      component: () => import('@/view/Template.vue'),
      redirect: '/index'
    },
    {
      path: '*',
      redirect: '/'
    },
    {
      path: '/modules',
      component: () => import('@/view/Modules.vue'),
      children: [
        {
          path: '/index',
          name: '后台首页',
          component: () => import('@/view/index.vue'),
          meta: { auth: true, id: '576700593796644866' }
        },
        {
          path: '/user',
          name: '用户管理',
          component: () => import('@/view/xitongshezhi/User.vue'),
          meta: { auth: true, id: '651336132025405441' }
        }
      ]
    }
  ]
})
